﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TEST4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            int a, h;
            try
            {
                a = Convert.ToInt32(textBox1.Text);
                h = Convert.ToInt32(textBox2.Text);

                for (int i = 0; i < 20; i++)
                    a = a + h;

                MessageBox.Show("累加结果："+a.ToString());
            }
            catch
            {
                MessageBox.Show("输入有误，请输入整数");
            }
           
        }
    }
}
